package org.hs.phd.odi.tracking.tracker.particlefilter.state;


public class SphericalWindowParticleState{
	
	public final double theta;
	public final double phi;
	public final double scale;
	public final double deltaTheta;
	public final double deltaPhi;
	
	public SphericalWindowParticleState(double theta, double phi, double deltaTheta, double deltaPhi) {
		this.theta = theta;
		this.phi = phi;
		this.scale = 1;
		this.deltaTheta = deltaTheta;
		this.deltaPhi = deltaPhi;
	}

	private SphericalWindowParticleState(SphericalWindowParticleState state, double newTheta, double newPhi, double newScale ) {
		this.theta = newTheta;
		this.phi = newPhi;
		this.scale = newScale;
		this.deltaTheta = state.deltaTheta;
		this.deltaPhi = state.deltaPhi;
	}

	public SphericalWindowParticleState createMovedScaledCopy(double newTheta, double newPhi, double newScale) {
		return new SphericalWindowParticleState(this, newTheta, newPhi, newScale);
	}
	
	
	@Override
	public String toString() {
		
		return "[" 
				+ Math.toDegrees(theta - scale*deltaTheta) + ","
				+ Math.toDegrees(phi - scale*deltaPhi) + ","
				+ Math.toDegrees(theta + scale*deltaTheta) + ","
				+ Math.toDegrees(phi + scale*deltaPhi) 
				+ "]";
	}
	
}
